package com.docking.heylo.web.controller;

import com.docking.heylo.service.IBigAService;
import com.docking.heylo.web.dto.BigADto;
import com.docking.heylo.web.utils.ResultUtil;
import com.docking.heylo.web.vo.BaseVo;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 大A管理
 *
 */
@RestController
@RequestMapping("/bigA")
public class BigVController {

    @Autowired
    private IBigAService bigAService;

    /***
     * 申请记录
     *
     * @return
     */
    @RequestMapping("/applicationRecord")
    public BaseVo applicationRecord(@RequestBody BigADto bigADto){
        PageInfo<Map<String, Object>> records = bigAService.applicationRecord(bigADto);
        return ResultUtil.success("成功", records);
    }

    /***
     * 通过
     *
     * @return
     */
    @RequestMapping("/audit")
    public BaseVo audit(@RequestBody BigADto bigADto){
        bigAService.audit(bigADto);
        return ResultUtil.success("审核成功");
    }


    /***
     * 大A列表
     *
     * @param bigADto
     * @return
     */
    @RequestMapping("/bigAList")
    public BaseVo bigAList(@RequestBody BigADto bigADto){
        PageInfo<Map<String, Object>> bigAList = bigAService.bigAList(bigADto);
        return ResultUtil.success("成功", bigAList);
    }











}
